keep votetrump2 republican Q12 income D2 age socialmedia T5 female educ S7 S9 bornabroad trust_fam T6a trust_natnews T6b trust_locnews T6c trust_socmed T6d trust_polead T6e freq T3 realorg_news T2 sp_news D10 spanish langpref mexam D1 D1B hisp S2 index deepstate3 bidenBLM3 powerfulpeople3 T7a T7b T7c

*Missinformation Index
gen index = deepstate3 + bidenBLM3 + powerfulpeople3

*recoded deepstate
gen deepstate3 = .
replace deepstate3 = -2 if T7c == 4
replace deepstate3 = -1 if T7c == 3
replace deepstate3 = 0 if T7c == 5
replace deepstate3 = 1 if T7c == 2
replace deepstate3 = 2 if T7c == 1

*recoded bidenBLM
gen bidenBLM3 = .
replace bidenBLM3 = -2 if T7b == 4
replace bidenBLM3 = -1 if T7b == 3
replace bidenBLM3 = 0 if T7b == 5
replace bidenBLM3 = 1 if T7b == 2
replace bidenBLM3 = 2 if T7b == 1

*recoded powerful people
gen powerfulpeople3 = .
replace powerfulpeople3 = -2 if T7a == 4
replace powerfulpeople3 = -1 if T7a == 3
replace powerfulpeople3 = 0 if T7a == 5
replace powerfulpeople3 = 1 if T7a == 2
replace powerfulpeople3 = 2 if T7a == 1




*Vote Trump: Certain + Leaners vs. Biden Certain and Leaners Undecided are out
gen votetrump2 = .
replace votetrump2 = 1 if Q12 == 1 | Q12 ==2 
replace votetrump2 = 0 if Q12 == 3 | Q12 == 4 |Q12 ==5 |Q12 ==6 

*Income variable
gen income = D2

*Education variable
gen educ = S10

*What is the most common way you get political and election news? Social Media = 1 
gen socialmedia=1 if T5==6 | T5 ==7
replace socialmedia=0 if T5==1 | T5== 2  | T5== 3 | T5== 4 | T5== 5 | T5== 7

*Female variable
gen female=1 if S7==2
replace female=0 if S7==1

*Boarnabroad
gen bornabroad1 = .
replace bornabroad1 = 1 if S9 == 3
replace bornabroad1 = 0 if S9 == 1 | S9 == 2

*trust family
gen trust_fam = .
replace trust_fam = 1 if T6a == 4
replace trust_fam = 2 if T6a == 3
replace trust_fam = 3 if T6a == 2
replace trust_fam = 4 if T6a == 1

*trust nat news orgs
gen trust_natnews = .
replace trust_natnews = 1 if T6b == 4
replace trust_natnews = 2 if T6b == 3
replace trust_natnews = 3 if T6b == 2
replace trust_natnews = 4 if T6b == 1

*trust local news orgs
gen trust_locnews = .
replace trust_locnews = 1 if T6c == 4
replace trust_locnews = 2 if T6c == 3
replace trust_locnews = 3 if T6c == 2
replace trust_locnews = 4 if T6c == 1

*trust social media
gen trust_socmed = .
replace trust_socmed = 1 if T6d == 4
replace trust_socmed = 2 if T6d == 3
replace trust_socmed = 3 if T6d == 2
replace trust_socmed = 4 if T6d == 1


*trust pol leaders
gen trust_polead= .
replace trust_polead = 1 if T6e == 4
replace trust_polead = 2 if T6e == 3
replace trust_polead = 3 if T6e == 2
replace trust_polead = 4 if T6e == 1

*How many news stories have you seen
gen freq = .
replace freq = 1 if T3 == 4
replace freq = 2 if T3 == 3
replace freq = 3 if T3 == 2
replace freq = 4 if T3 == 1

*Real News vs. made-up shit
gen realorg_news = .
replace realorg_news = 1 if T2 == 4
replace realorg_news = 2 if T2 == 3
replace realorg_news = 3 if T2 == 2
replace realorg_news = 4 if T2 == 1

*When you do look for news and information on TV, radio or websites, how often do you access information on Spanish-language outlets?
gen sp_news = .
replace sp_news = 1 if D10 == 4
replace sp_news = 2 if D10 == 3
replace sp_news = 3 if D10 == 2
replace sp_news = 4 if D10 == 1

*language preference
gen spanish = .
replace spanish = 1 if langpref == 1
replace spanish = 0 if langpref == 2

*Mexican American
gen mexam = .
replace mexam = 1 if D1 == 12 | D1B == 1
replace mexam = 0 if mexam == .

*Hispanic and Other Ethnicity Race
gen hisp = .
replace hisp = 1 if S2 == 1
replace hisp = 0 if S2 != 1

*Table 2
reg index votetrump2 republican income educ c.age##socialmedia  female bornabroad trust_fam trust_natnews trust_locnews  trust_socmed trust_polead freq realorg_news  sp_news spanish mexam hisp


*PCA
pca bidenBLM3 deepstate3 powerfulpeople3
screeplot

*Appendix Tables
reg powerfulpeople3 votetrump2 republican income educ c.age##socialmedia  female bornabroad trust_fam trust_natnews trust_locnews  trust_socmed trust_polead freq realorg_news  sp_news spanish mexam hisp

reg deepstate3 votetrump2 republican income educ c.age##socialmedia  female bornabroad trust_fam trust_natnews trust_locnews  trust_socmed trust_polead freq realorg_news  sp_news spanish mexam hisp

reg bidenBLM3 votetrump2 republican income educ c.age##socialmedia  female bornabroad trust_fam trust_natnews trust_locnews  trust_socmed trust_polead freq realorg_news  sp_news spanish mexam hisp

